<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddOrderPercentToConfigSalesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('config_sales', function (Blueprint $table) {
            $table->decimal('order_own_rewards_percent', 10, 2)->default(33.00)->comment("自购佣金分佣比例");
            $table->decimal('order_parent_rewards_percent', 10, 2)->default(33.00)->comment("直推用户分佣比例");
            $table->decimal('order_team_rewards_percent', 10, 2)->default(33.00)->comment("团队用户分佣比例");
            
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('config_sales', function (Blueprint $table) {
            $table->dropColumn(['order_own_rewards_percent','order_parent_rewards_percent','order_team_rewards_percent']);
        });
    }
}
